package cn.itsource.org.domain;

import cn.itsource.basic.basic.domain.Basedomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Department extends Basedomain {
    //id
    //部门编号 唯一标识
    private String sn;
    //部门名称
    private String name;
    //部门状态，0正常，-1禁用
    private Integer state;
    //部门管理员，关联Employee表id
    private Long manager_id;
    //上级部门
    private Long parent_id;

    private Employee manager;
    //从顶级id到他自己
    private String path;

    private Department parent;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    List<Department> children = new ArrayList<>();
}
